package com.woniu.guoguo.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woniu.guoguo.model.Menu;
import com.woniu.guoguo.dao.MenuMapper;
import com.woniu.guoguo.model.MenuImg;
import com.woniu.guoguo.service.IMenuService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Richie
 * @since 2020-11-02
 */
@Service
public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements IMenuService {

    @Autowired
    private MenuMapper menuMapper;

    @Override
    public List<Menu> findMenusByRestId(Integer restaurantId) {
        return menuMapper.findMenusByRestId(restaurantId);
    }

    @Override
    public IPage<Menu> getmenubytype(Page<Menu> page,String type) {

        return menuMapper.getmenubutype(page,type);
    }

    @Override
    public IPage<String> getmenuimgbytype(Page<String> page, String type) {
        return menuMapper.getmenuimgbytype(page,type);
    }

    @Override
    public IPage<Menu> xlgetmenu(Page<String> page, String type) {
        return menuMapper.xlgetmenu(page,type);
    }

    @Override
    public IPage<String> xlgetmenuimg(Page<String> page, String type) {
        return menuMapper.xlgetmenuimg(page,type);
    }

    @Override
    public IPage<Menu> jggetmenu(Page<String> page, String type) {
        return menuMapper.jggetmenu(page,type);
    }

    @Override
    public IPage<String> jggetmenuimg(Page<String> page, String type) {
        return menuMapper.jggetmenuimg(page,type);
    }

    @Override
    public void addASaleByMenuId(int menuId) {
        menuMapper.addASaleByMenuId(menuId);
    }


    //根据价格

    @Override
    public IPage<Menu> getmenubyname(Page<Menu> page,String name) {

        return menuMapper.getmenubuname(page,name);
    }

    @Override
    public IPage<String> getmenuimgbyname(Page<String> page, String name) {
        return menuMapper.getmenuimgbyname(page,name);
    }

    @Override
    public IPage<Menu> xlgetmenu2(Page<String> page, String name) {
        return menuMapper.xlgetmenu2(page,name);
    }

    @Override
    public IPage<String> xlgetmenuimg2(Page<String> page, String name) {
        return menuMapper.xlgetmenuimg2(page,name);
    }

    @Override
    public IPage<Menu> jggetmenu2(Page<String> page, String name) {
        return menuMapper.jggetmenu2(page,name);
    }

    @Override
    public IPage<String> jggetmenuimg2(Page<String> page, String name) {
        return menuMapper.jggetmenuimg2(page,name);
    }
}
